package apiday01;

/**
 * boolean startsWith(String str)
 * 判断当前字符串是否是以给定的字符串开始
 * boolean endsWith(String str)
 * 判断当前字符串是否一给定的字符串结尾的
 */
public class StartsWithDemo {
    public static void main(String[] args) {
       String str = "我不想加班啊啊啊啊！";
       boolean  starts = str.startsWith("我");
       System.out.println(starts);
       boolean ends = str.endsWith("啊啊啊！");
       System.out.println(ends);


        /* String  str = "我是法外狂徒，张三是也！";
        boolean starts = str.startsWith("我是");
        System.out.println(starts);
        boolean ends = str.endsWith("是也！");
        System.out.println(ends);

        */



        /*String str = "thinking in java";
        boolean starts = str.startsWith("think"); //判断str是否是以think开头
        System.out.println("starts:"+starts); //true

        boolean ends = str.endsWith("ava");//判断str是否是以ava结尾
        System.out.println("ends:"+ends);//true

         */
    }
}
